package com.fit.entities;

import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;
import org.apache.tapestry5.beaneditor.Validate;

@Table(name = "reservations")
@Entity
public class Reservation {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "reservation_id", nullable = false)
	private Long id;
	@Validate("required")
	@Column(name = "reservation_reservationDate", nullable = false)
	private Calendar reservationDate;
	@Validate("required")
	@ManyToOne(optional = true)
	@JoinColumn(name = "reseration_arrangement", nullable = false)
	private Arrangement arrangement;
	@Validate("required")
	@ManyToOne(optional = true)
	@JoinColumn(name = "reservation_client", nullable = false)
	private Client client;
	@Validate("required")
	@ManyToOne(optional = true)
	@JoinColumn(name = "reservation_employee", nullable = false)
	private Employee employee;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Calendar getReservationDate() {
		return reservationDate;
	}

	public void setReservationDate(Calendar reservationDate) {
		this.reservationDate = reservationDate;
	}

	public Arrangement getArrangement() {
		return arrangement;
	}

	public void setArrangement(Arrangement arrangement) {
		this.arrangement = arrangement;
	}

	public Client getClient() {
		return client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

}
